/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package stealth;

/**
 * This class represents a state machine that monitors what we
 * are currently doing in the game. For instance, if MENU_STATE is the current
 * state, then the game should be rendering the Menu.
 * @author Joshua Mabrey
 */
public class GameState {
    public static final short MENU_STATE = 0;
    public static final short ONE_PLAYER_GAME_STATE = 1;
    public static final short SCORE_STATE = 2;
    public static final short NAME_CHANGE_STATE = 3;
    
    private static final short low_State = 0;
    private static final short high_State = 3;
    
    private static short state = 0;

    /**
     * This method returns the current state.
     * @return 
     */
    public static short getState(){
        return state;
    }
    
    public static void setState(short s){
        if(s >= low_State && s <= high_State){
            state = s;
        }
        else throw new IllegalArgumentException("setState must be passed a valid state. Perhaps update states?");
        Main.game.actOnStateChange();
    }
    
}
